From: Kunal Mehta Date: Fri, 20 May 2016 01:58:34 +0000 (-0700) Subject: Avoid invidual LinkCache lookups in Linker::makeBrokenImageLinkObj() X-Git-Tag: 1.31.0-rc.0~6847^2 X-Git-Url: http://git.cyclocoop.org/%7D%7Cconcat%7B?a=commitdiff_plain;h=1f7d032f8309fe60561c1f085bc8bf6f03786299;p=lhc%2Fweb%2Fwiklou.git Avoid invidual LinkCache lookups in Linker::makeBrokenImageLinkObj() Change-Id: I29ab072519937b770e75a40382d2f77cbabe098b --- diff --git a/includes/Linker.php b/includes/Linker.php index 20dc9b264a..66cf325d67 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -940,7 +940,15 @@ class Linker { $redir = RepoGroup::singleton()->getLocalRepo()->checkRedirect( $title ); if ( $redir ) { - return self::linkKnown( $title, $encLabel, [], wfCgiToArray( $query ) ); + // We already know it's a redirect, so mark it + // accordingly + return self::link( + $title, + $encLabel, + [ 'class' => 'mw-redirect' ], + wfCgiToArray( $query ), + [ 'known', 'noclasses' ] + ); } $href = self::getUploadUrl( $title, $query ); @@ -950,7 +958,7 @@ class Linker { $encLabel . ''; } - return self::linkKnown( $title, $encLabel, [], wfCgiToArray( $query ) ); + return self::link( $title, $encLabel, [], wfCgiToArray( $query ), [ 'known', 'noclasses' ] ); } /** diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index 930c87923a..e93aa7e09c 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -13944,7 +13944,7 @@ Redirected image !! wikitext [[Image:Barfoo.jpg]] !! html/php -

File:Barfoo.jpg +

File:Barfoo.jpg

!! end